package errno

//保存错误码

//1位数 服务级别错误：1 为系统级错误；2 为普通错误，通常是由用户非法操作引起的
//2位数 服务模块代码：
//2位数 具体错误代码
var (
	// Common errors
	OK                  = &Errno{Code: 0, Message: "OK"}
	InternalServerError = &Errno{Code: 10001, Message: "Internal server error"}
	ErrBind             = &Errno{Code: 10002, Message: "Error occurred while binding the request body to the struct."}

	ErrDatabase      = &Errno{Code: 20001, Message: "Database error"}
	ErrValidation    = &Errno{Code: 20002, Message: "Validation failed."} //数据合法性验证错误
	ErrEncrypt       = &Errno{Code: 20003, Message: "Error occurred while encrypting the user password."}
	ErrMissingHeader = &Errno{Code: 20004, Message: "Missing header"}
	ErrToken         = &Errno{Code: 20005, Message: "Sign token failed."}

	// admin errors
	ErrAdminNotFound     = &Errno{Code: 20101, Message: "The admin was not found."}
	ErrPasswordIncorrect = &Errno{Code: 20102, Message: "The password was not true."}
	ErrTokenInvalid      = &Errno{Code: 20103, Message: "The token was invalid"}

	// student errors
	ErrStudentNotFound   = &Errno{Code: 20201, Message: "The student was not found."}
	ErrStudentPermission = &Errno{Code: 20202, Message: "The student no permission."}
)
